package cate.common.table.activity.taskactivity.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.taskactivity.row.TaskActivityTaskRow;

import java.util.ArrayList;
import java.util.List;

public class TaskActivityTaskSheet extends ESheet<TaskActivityTaskRow> {
    @Override
    public String getSheetName() {
        return "任务";
    }

    public List<Integer> getTaskIds(int group) {
        List<Integer> taskIds = new ArrayList<>();
        for (TaskActivityTaskRow row : this.getList()) {
            if (row.taskGroup == group) {
                taskIds.add(row.taskId);
            }
        }
        return taskIds;
    }

    public List<Integer> getDayTaskIds(int group, int day) {
        List<Integer> taskIds = new ArrayList<>();
        for (TaskActivityTaskRow row : this.getList()) {
            if (row.taskGroup == group && row.day == day) {
                taskIds.add(row.taskId);
            }
        }
        return taskIds;
    }

}
